import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { Test2Component } from './view/test2/test2.component';
import { Test3Component } from './view/test3/test3.component';
import { AppRouteGuardService } from './app-route-guard.service';
import { from } from 'rxjs';

const routes: Routes = [
  { path: '', component: Test2Component },
  { path: 'test1', loadChildren: () => import('./view/test1/test1.module').then(m => m.Test1Module) },
  { path: 'test2', component: Test2Component, canActivate: [AppRouteGuardService] },
  { path: 'test3', component: Test3Component },
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
  providers: [AppRouteGuardService]
})
export class AppRoutingModule { }
